<?php

if($_GET['id']){
    $link = mysql_connect('mysql-88.ukraine.com.ua', 'barthez_ai', 'x9gedv4w');
    if (!$link) {
        die('Could not connect: ' . mysql_error());
    }
    mysql_select_db('barthez_ai');

    $sql = "SELECT * FROM `imdb250`";
    $result = mysql_query($sql);

    $films = array();
    while($row = mysql_fetch_assoc($result)){
        $films[$row['id']]=$row;
    }
    
    $sql = "UPDATE `imdb250` SET rating = ".($films[$_GET['id']]['rating']+1)." WHERE id=".$_GET['id'];
    $result = mysql_query($sql);

}
?>
